/**
 * Created by msi on 2018/4/9.
 */
require("./result.css");
require("page/common/nav-simple/nav-simple.js");
var _mm = require("util/mm.js");

$(function(){
    var type = _mm.getUrlParam("type") || "default";
    $element = $("."+type+"-success");
    if(type === 'payment'){
        var orderNumber  = _mm.getUrlParam('orderNumber'),
            $orderNumber = $element.find('.order-number');
        $orderNumber.attr('href', $orderNumber.attr('href') + orderNumber);
    }
    $element.show();

    var time = 5;
    setInterval(function(){
        if(time === 0){
            switch (type){
                case "register": window.location.href = "./user-login.html";break;
                case "password-reset": window.location.href = "./user-login.html";break;
                case "seller-register": window.location.href = "./seller-product-list.html";break;
            }
        }else{
            switch (type){
                case "register": $("#show").text(time+"秒后自动跳转到登录页面");break;
                case "password-reset": $("#show").text(time+"秒后自动跳转到登录页面");break;
                case "seller-register": $("#show").text(time+"秒后自动跳我的商城");break;
            }
            time--;
        }
    },1000);
});


